#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project  : ecshop-gitee
# @File     : page_ecshop_back_create_order.py
# @Author   : LiuLei
# @Time     : 2021/7/3 10:33
from selenium.webdriver.common.by import By


class PageEcshopBackCreateOder():
    """
    1.进入后台页面；
    2.点击查看订单
    3.点击生成发货单
    4.点击发货
    5.进入前台查询订单状态
    """

    def __init__(self, driver):
        self.driver = driver

        # 点击查看商品详情
        self.loc_ecshop_create = (By.XPATH, '/html/body/form/div[4]/table/tbody/tr[3]/td[2]/input[3]')
        self.loc_ecshop_affirm = (By.NAME, 'delivery_confirmed')

    def back_ecshop_create(self):
        """
        1.点击查看按钮
        2.点击生成订单
        """
        self.driver.find_element(*self.loc_ecshop_create).click()
        self.driver.find_element(*self.loc_ecshop_affirm).click()

    def back_ecshop_create_oder(self):
        self.back_ecshop_create()
